import { defineStore } from 'pinia';
import { reqGetFileListByToken, reqDeleteFile } from '@/api/file';
import { requestGetData, requestIsSuccess } from '@/api/request';

export const useFilesStore = defineStore('files', {
  state: () => ({
    fileList: [] as any[],
  }),
  actions: {
    async getFileListByToken() {
      const result = await reqGetFileListByToken();
      
        this.fileList = result.data
      
    },
    async deleteFile(id: string, source: string) {
      const result = await reqDeleteFile(id, source);
      return result;
    },
  },
  getters: {
    // 原 getters 为空，若有需求可在此添加
  },
});    